package com.qfjy.homework.YangJin;


import java.util.ArrayList;
import java.util.List;
/**
 * @author : --
 * @version :1.0
 * @date : 2022/6/29 18:53
 */

//创建命令调用类，同时多个人买卖
public class Broker {
    List<Order> orderList = new ArrayList<Order>();

    public void takeOrder(Order order){
        orderList.add(order);
    }

    //遍历命令
    public void placeOrders(){
        for (Order order : orderList) {
            order.execute();
        }
        orderList.clear();
    }
}
